#!/usr/bin/env bash

## Copyright (C) 2020-2022 Aditya Shakya <adi1090x@gmail.com>
##
## Autostart Programs

# Kill already running process
_ps=(waybar mako mpd polkit-gnome-authentication-agent-1)
for _prs in "${_ps[@]}"; do
	if [[ `pidof ${_prs}` ]]; then
		killall -9 ${_prs}
	fi
done

# Polkit agent
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &

# Set wallpaper
swaybg --output '*' --mode fill --image ~/.config/hypr/wallpapers/wallpaper.png &

# Apply themes
# ~/.config/hypr/scripts/gtkthemes &

# Lauch notification daemon (mako)
~/.config/hypr/scripts/notifications &

# Lauch statusbar (waybar)
~/.config/hypr/scripts/statusbar &

# 
exec fcitx5 -d
# Start mpd
exec mpd &
